<?php
	require_once(LC_PATH.'core/class_loader.class.php');

	function __autoload($name) {
		class_loader::load($name);
	}

	try {
		/** instansiate registry **/
		$reg = new registry();

		/** instansiate core components **/
		$reg->session = new session();
		$reg->layout = new layout($reg);

		/** instansiate DAL **/
		init_dal($reg);

		/** route and execute **/
		$reg->route = isset($_GET['rt']) ? $_GET['rt'] : '';
		$reg->router = new router($reg);
		$reg->router->route();

	} catch(Exception $e) {
		die($e->getMessage());
	}
?>
